package com.example.takeaway.converter;

import com.example.takeaway.model.bo.Category;
import com.example.takeaway.model.dto.CategoryDTO;
import com.example.takeaway.model.dto.CategoryEditorDTO;
import com.example.takeaway.model.vo.CategoryVO;
import org.mapstruct.Mapper;

import java.util.List;

/**
 * @author 邢晨旭
 * {@code @date} 2023/10/14
 */
@Mapper(componentModel = "spring")
public interface CategoryConverter {

    /**
     * dto转bo
     * @param param dto
     * @return bo
     */
    Category toCategory(CategoryDTO param);

    /**
     * dto转bo
     * @param param dto
     * @return bo
     */
    Category toCategory(CategoryEditorDTO param);

    /**
     * bo转vo
     * @param category bo
     * @return vo
     */
    CategoryVO toCategoryVO(Category category);

    /**
     * bo转vo
     * @param category bo
     * @return vo
     */
    List<CategoryVO> toCategoryVO(List<Category> category);
}
